package com.xnx3.banmahuishou.core.entity;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;

import com.xnx3.j2ee.entity.BaseEntity;

/**
 * 代理商微信网页充值记录表
 * @author 王晓龙
 */
@Entity()
@Table(name = "laji_recharge_log")
public class RechargeLog extends BaseEntity implements java.io.Serializable {
	private Integer id;	//自增id
	private String channel;	//支付方式,例如: wx：微信，现在只有微信支付
	private Integer addtime;	//创建时间
	private Integer money;	//充值金额 单位：分
	private String orderno;	//订单编号，32位商户订单号
	private Integer userid;	//支付的用户，关联user.id
	private Integer version;	//乐观锁
	private String remark;	//金额变更描述
	private String username;	//支付用户的名称,关联user.nickname
	private String phone;	//支付用户的手机号
	private Integer paytime;	//支付时间
	private Short state;	//支付状态。支付返回状态 0：未支付 1：成功 2：失败
	private String tradePayId;	//第三方支付订单ID
	
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	@Column(name = "channel", columnDefinition="char(10) COLLATE utf8_unicode_ci COMMENT '支付方式,例如: wx：微信，现在只有微信支付' default ''")
	public String getChannel() {
		return channel;
	}
	public void setChannel(String channel) {
		this.channel = channel;
	}
	@Column(name = "addtime", columnDefinition="int(11) COMMENT '创建时间' default '0'")
	public Integer getAddtime() {
		return addtime;
	}
	public void setAddtime(Integer addtime) {
		this.addtime = addtime;
	}
	@Column(name = "money", columnDefinition="int(11) COMMENT '充值金额 单位：分' default '0'")
	public Integer getMoney() {
		return money;
	}
	public void setMoney(Integer money) {
		this.money = money;
	}
	@Column(name = "orderno", columnDefinition="char(60) COLLATE utf8_unicode_ci COMMENT '订单编号，32位商户订单号' default ''")
	public String getOrderno() {
		return orderno;
	}
	public void setOrderno(String orderno) {
		this.orderno = orderno;
	}
	@Column(name = "userid", columnDefinition="int(11) COMMENT '支付的用户，关联user.id' default '0'")
	public Integer getUserid() {
		return userid;
	}
	public void setUserid(Integer userid) {
		this.userid = userid;
	}
	@Version
	@Column(name = "version", columnDefinition="int(11) COMMENT '乐观锁' default '0'")
	public Integer getVersion() {
		return version;
	}
	public void setVersion(Integer version) {
		this.version = version;
	}
	@Column(name = "remark", columnDefinition="char(255) COLLATE utf8_unicode_ci COMMENT '金额变更描述' default ''")
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	@Column(name = "username", columnDefinition="char(30) COLLATE utf8_unicode_ci COMMENT '支付用户的名称,关联user.nickname' default ''")
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	@Column(name = "phone", columnDefinition="char(11) COLLATE utf8_unicode_ci COMMENT '支付用户的手机号' default ''")
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	@Column(name = "paytime", columnDefinition="int(11) COMMENT '支付时间' default '0'")
	public Integer getPaytime() {
		return paytime;
	}
	public void setPaytime(Integer paytime) {
		this.paytime = paytime;
	}
	@Column(name = "state", columnDefinition="tinyint(2) COMMENT '支付状态。支付返回状态 0：未支付 1：成功 2：失败' default '0'")
	public Short getState() {
		return state;
	}
	public void setState(Short state) {
		this.state = state;
	}
	@Column(name = "trade_pay_id", columnDefinition="char(150) COLLATE utf8_unicode_ci COMMENT '第三方支付订单ID' default ''")
	public String getTradePayId() {
		return tradePayId;
	}
	public void setTradePayId(String tradePayId) {
		this.tradePayId = tradePayId;
	}
	@Override
	public String toString() {
		return "RechargeLog [id=" + id + ", channel=" + channel + ", addtime=" + addtime + ", money=" + money
				+ ", orderno=" + orderno + ", userid=" + userid + ", version=" + version + ", remark=" + remark
				+ ", username=" + username + ", phone=" + phone + ", paytime=" + paytime + ", state=" + state
				+ ", tradePayId=" + tradePayId + "]";
	}
	
}
